package com.yyj;

public class Phone implements Comparable<Phone>{
    private String phone;
    private Integer num;
    private Double money;

    public Phone() {

    }

    public Phone(String phone, Integer num, Double money) {
        this.phone = phone;
        this.num = num;
        this.money = money;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    @Override
    public String toString() {
        return "Phone{" +
                "phone='" + phone + '\'' +
                ", num=" + num +
                ", money=" + money +
                '}';
    }

    public int compareTo(Phone o) {
        return money > o.money ? -1 : 1;
    }
}
